import { useDispatch, useSelector, useStore } from 'react-redux';
import React, { useEffect } from 'react'

const Child = (props) => {
  const num = useSelector((state) => {
    return state.num
  })

  const dispatch = useDispatch();

  // console.log(useStore());

  useEffect(() => {
    setInterval(() => {
      dispatch({
        type: 'ADD'
      })
    }, 1000)
  }, [])

  return (
    <div>
      child
      <p>{num}</p>
    </div>
  )
}

export default Child;